package top.codedance.iotp.serialPortSDK.enums;


public enum AlarmTypeEnum {

    TYPE0001("0001", "设置数据警告", "Tank Setup data Warning（设置数据警告）"),
    TYPE0002("0002", "泄漏报警", "Tank Leak Alarm（泄漏报警）"),
    TYPE0003("0003", "高水位报警", "Tank High Water Alarm（高水位报警）"),
    TYPE0004("0004", "罐满溢警报", "Tank Overfill Alarm（罐满溢警报）"),
    TYPE0005("0005", "低油位报警", "Tank Low Product Alarm（低油位报警）"),
    TYPE0006("0006", "突然损失警报", "Tank Sudden Loss Alarm（突然损失警报）"),
    TYPE0007("0007", "高油位报警", "Tank High Product Alarm（高油位报警）"),
    TYPE0008("0008", "油位无效报警", "Tank Invalid Fuel Level Alarm（油位无效报警）"),
    TYPE0009("0009", "探头报警", "Tank Probe Out Alarm（探头报警）"),
    TYPE000A("000A", "高水位警告", "Tank High Water Warning（高水位警告）"),
    TYPE000B("000B", "需要进油", "Tank Delivery Needed Warning（油罐输送需要警告）"),
    TYPE000C("000C", "最大油高报警", "Tank maximum Product Alarm（罐最大油位报警）"),
    TYPE000D("000D", "总泄漏测试失败报警", "Tank gross leak test fail Alarm（总泄漏测试失败报警）"),
    TYPE000E("000E", "定期泄漏测试失败报警", "Tank periodic leak test fail Alarm（定期泄漏测试失败报警）"),
    TYPE000F("000F", "年度泄漏测试失败报警", "Tank annual leak test fail Alarm（年度泄漏测试失败报警）"),
    TYPE0010("0010", "周期性试验需要警告", "Tank periodic test Needed Warning（周期性试验需要警告）"),
    TYPE0011("0011", "年度试验需要警告", "Tank annual test Needed Warning（年度试验需要警告）"),
    TYPE0012("0012", "周期性试验需要报警", "Tank periodic test Needed Alarm（周期性试验需要报警）"),
    TYPE0013("0013", "年度试验需要报警", "Tank annual test Needed Alarm（年度试验需要报警）"),
    TYPE0014("0014", "泄漏试验开始", "Tank leak test active（泄漏试验开始）"),
    TYPE0015("0015", "无csld空闲时间警告", "Tank no csld idle time Warning（无csld空闲时间警告）"),
    TYPE0016("0016", "虹吸中断主动警告", "Tank siphon break active Warning（虹吸中断主动警告）"),
    TYPE0017("0017", "csld率增加警告", "Tank csld rate increase Warning（csld率增加警告）"),
    TYPE0018("0018", "校准警告", "Tank accuchart calibration Warning（校准警告）"),
    TYPE0019("0019", "人力资源管理和解警告", "Tank HRM reconciliation Warning（人力资源管理和解警告）"),
    TYPE001A("001A", "人力资源管理调节报警", "Tank HRM reconciliation Alarm（人力资源管理调节报警）"),
    TYPE001B("001B", "冷温度警告", "Tank cold temperaturn Warning（冷温度警告）"),
    TYPE001C("001C", "油罐遗失交货单警告", "Tank missing delivery ticket Warning（油罐遗失交货单警告）"),
    TYPE001D("001D", "/管路总泄漏报警", "Tank/line gross leak Alarm（/管路总泄漏报警）"),
    ;

    private String code;
    private String name;
    private String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    AlarmTypeEnum(String code, String name, String desc) {
        this.code = code;
        this.name = name;
        this.desc = desc;
    }

    public static AlarmTypeEnum getByCode(String code) {
        if (code != null) {
            for (AlarmTypeEnum item : AlarmTypeEnum.values()) {
                if (item.getCode().equals(code)) {
                    return item;
                }
            }
        }
        return null;
    }

}
